import java.util.ArrayList;
import java.util.List;

/**
 * @author wangj881
 * @date 2025-03-04 17:42
 */
public class L94_3 {

    class Solution {
        public List<Integer> inorderTraversal(TreeNode root) {

            ArrayList<Integer> list = new ArrayList<>();

            bianli(root, list);

            return list;
        }

        private void bianli(TreeNode root, ArrayList<Integer> list) {
            if (null == root) {
                return;
            }
            bianli(root.left, list);
            list.add(root.val);
            bianli(root.right, list);
        }
    }
}
